﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows;
using System.Windows.Controls;

namespace IntoTheVoid
{
	public class RichButton : Button
	{
		static RichButton()
		{
			DefaultStyleKeyProperty.OverrideMetadata(typeof(RichButton), new FrameworkPropertyMetadata(typeof(RichButton)));
		}
		#region 依赖属性

		//图片
		public ImageSource Icon
		{
			get { return (ImageSource)GetValue(IconProperty); }
			set { SetValue(IconProperty, value); }
		}

		// Using a DependencyProperty as the backing store for Icon.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty IconProperty =
			DependencyProperty.Register("Icon", typeof(ImageSource), typeof(RichButton));

		//图片尺寸
		public double IconSize
		{
			get { return (double)GetValue(IconSizeProperty); }
			set { SetValue(IconSizeProperty, value); }
		}

		// Using a DependencyProperty as the backing store for IconSize.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty IconSizeProperty =
			DependencyProperty.Register("IconSize", typeof(double), typeof(RichButton), new PropertyMetadata(25d));

		//图片与文字间隔
		public Thickness IconMargin
		{
			get { return (Thickness)GetValue(IconMarginProperty); }
			set { SetValue(IconMarginProperty, value); }
		}

		// Using a DependencyProperty as the backing store for IconMargin.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty IconMarginProperty =
			DependencyProperty.Register("IconMargin", typeof(Thickness), typeof(RichButton));

		//图片与文字排列方式
		public Orientation Orientation
		{
			get { return (Orientation)GetValue(OrientationProperty); }
			set { SetValue(OrientationProperty, value); }
		}

		// Using a DependencyProperty as the backing store for Orientation.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty OrientationProperty =
			DependencyProperty.Register("Orientation", typeof(Orientation), typeof(RichButton));
		#endregion
	}
}
